package com.own.business.exam.entity.bo;


import com.own.business.exam.entity.po.ExamCustomerRank;
import com.own.component.common.base.entity.BaseBo;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.math.BigDecimal;

/**
 * ExamCustomerRankBo
 *
 * @author chenxueli
 * @date 2021/05/18 14:43:47
 */
@Schema(title = "考试自定义等级表" + ConstantBeanSuffix.BO)
@Getter
@Setter
@ToString
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class ExamCustomerRankBo extends BaseBo<ExamCustomerRank> {

    @Schema(title = "考试id")
    private Long examId;

    @Schema(title = "考试标题")
    private BigDecimal score;

    @Schema(title = "级别名称标识")
    private String name;

    /**
     * 转持久化对象
     *
     * @param entity 原持久化对象
     * @return 持久化对象
     */
    @Override
    public ExamCustomerRank toPo(ExamCustomerRank entity) {
        if (entity == null) {
            entity = new ExamCustomerRank();
        }
        entity.setFkExamId(examId);
        entity.setScore(score);
        entity.setName(name);
        return super.toPo(entity);
    }

}
